<?php

/**
 * ģ�飺֪ͨ�ص��ӿ�
 * @copyright (C)2011 Cenwor Inc.
 * @author Moyo <dev@uuland.org>
 * @package module
 * @name txb.mod.php
 * @version 1.0
 */

class ModuleObject extends MasterObject
{
	function ModuleObject( $config )
	{
		$this->MasterObject($config);
		$runCode = Load::moduleCode($this);
		$this->$runCode();
	}
	function Main()
	{
		$out_trade_no=get("out_trade_no");
		$request_token=get("request_token");
		$result=get("result");
		$trade_no=get("trade_no");
		$sign=get("sign");
		$sign_type=get("sign_type");
		
		
		
		/*
		 [mod] => txb
		[out_trade_no] => 2014042505387
		[request_token] => requestToken
		[result] => success
		[trade_no] => 2014042504506859
		[sign] => 4c3528efb3e7a8c291f2295d1596c24d
		[sign_type] => MD5
		*/

		//$id="2014042546191";
		$order = logic('order')->GetOne($out_trade_no);
		$pid=$order["paytype"];
		$total_fee=$order["totalprice"];
		
		$url="/index.php?mod=callback&pid=$pid&out_trade_no=$out_trade_no&request_token=$request_token&result=$result&trade_no=$trade_no&sign=$sign&sign_type=$sign_type&total_fee=$total_fee";
		header("location:$url");
		
		exit();
		
	}
	private function Ends()
	{
		echo 'woo.^_^.oow';
	}
}

?>
